package com.sunlands.zlcx.usercenter.repository;

import com.sunlands.zlcx.usercenter.domain.VipUserSetMealRecordDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author shixiaopeng
 */
@Repository
public interface VipUserSetMealRecordRepository extends JpaRepository<VipUserSetMealRecordDO, Long> , JpaSpecificationExecutor<VipUserSetMealRecordDO> {

    VipUserSetMealRecordDO findByOrderNoAndOperateType(String orderNo, Integer operateType);

    Integer countByUserIdAndTypeAndOperateType(Long userId, Integer type, Integer operateType);

    List<VipUserSetMealRecordDO> findAllByUserIdAndOperateTypeAndSetMealIdInOrderByCreateTimeAsc(Long userId, Integer operateType, List<Long> setMealIds);
}
